import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/closure/closure_appointment_entity.dart';
import 'package:enterprise_v6_app/app/data/entities/closure/gate_equipment_entity.dart';


ClosureAppointmentEntity $ClosureAppointmentEntityFromJson(Map<String, dynamic> json) {
  final ClosureAppointmentEntity closureAppointmentEntity = ClosureAppointmentEntity();
  final String? affiliatedUnit = jsonConvert.convert<String>(json['affiliatedUnit']);
  if (affiliatedUnit != null) {
    closureAppointmentEntity.affiliatedUnit = affiliatedUnit;
  }
  final int? appointmentStatus = jsonConvert.convert<int>(json['appointmentStatus']);
  if (appointmentStatus != null) {
    closureAppointmentEntity.appointmentStatus = appointmentStatus;
  }
  final String? carStatus = jsonConvert.convert<String>(json['carStatus']);
  if (carStatus != null) {
    closureAppointmentEntity.carStatus = carStatus;
  }
  final String? carType = jsonConvert.convert<String>(json['carType']);
  if (carType != null) {
    closureAppointmentEntity.carType = carType;
  }
  final String? carTypeValue = jsonConvert.convert<String>(json['carTypeValue']);
  if (carTypeValue != null) {
    closureAppointmentEntity.carTypeValue = carTypeValue;
  }
  final String? company = jsonConvert.convert<String>(json['company']);
  if (company != null) {
    closureAppointmentEntity.company = company;
  }
  final String? companyCode = jsonConvert.convert<String>(json['companyCode']);
  if (companyCode != null) {
    closureAppointmentEntity.companyCode = companyCode;
  }
  final String? contactPerson = jsonConvert.convert<String>(json['contactPerson']);
  if (contactPerson != null) {
    closureAppointmentEntity.contactPerson = contactPerson;
  }
  final String? contactPersonId = jsonConvert.convert<String>(json['contactPersonId']);
  if (contactPersonId != null) {
    closureAppointmentEntity.contactPersonId = contactPersonId;
  }
  final String? createBy = jsonConvert.convert<String>(json['createBy']);
  if (createBy != null) {
    closureAppointmentEntity.createBy = createBy;
  }
  final String? createById = jsonConvert.convert<String>(json['createById']);
  if (createById != null) {
    closureAppointmentEntity.createById = createById;
  }
  final String? createDate = jsonConvert.convert<String>(json['createDate']);
  if (createDate != null) {
    closureAppointmentEntity.createDate = createDate;
  }
  final String? deleted = jsonConvert.convert<String>(json['deleted']);
  if (deleted != null) {
    closureAppointmentEntity.deleted = deleted;
  }
  final String? destination = jsonConvert.convert<String>(json['destination']);
  if (destination != null) {
    closureAppointmentEntity.destination = destination;
  }
  final String? empower = jsonConvert.convert<String>(json['empower']);
  if (empower != null) {
    closureAppointmentEntity.empower = empower;
  }
  final String? endDate = jsonConvert.convert<String>(json['endDate']);
  if (endDate != null) {
    closureAppointmentEntity.endDate = endDate;
  }
  final int? expire = jsonConvert.convert<int>(json['expire']);
  if (expire != null) {
    closureAppointmentEntity.expire = expire;
  }
  final List<GateEquipmentEntity>? gateEquipmentList = (json['gateEquipmentList'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<GateEquipmentEntity>(e) as GateEquipmentEntity).toList();
  if (gateEquipmentList != null) {
    closureAppointmentEntity.gateEquipmentList = gateEquipmentList;
  }
  final String? gateEquipmentNames = jsonConvert.convert<String>(json['gateEquipmentNames']);
  if (gateEquipmentNames != null) {
    closureAppointmentEntity.gateEquipmentNames = gateEquipmentNames;
  }
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    closureAppointmentEntity.id = id;
  }
  final String? idCard = jsonConvert.convert<String>(json['idCard']);
  if (idCard != null) {
    closureAppointmentEntity.idCard = idCard;
  }
  final String? idNo = jsonConvert.convert<String>(json['idNo']);
  if (idNo != null) {
    closureAppointmentEntity.idNo = idNo;
  }
  final String? inGateNo = jsonConvert.convert<String>(json['inGateNo']);
  if (inGateNo != null) {
    closureAppointmentEntity.inGateNo = inGateNo;
  }
  final String? licensePlate = jsonConvert.convert<String>(json['licensePlate']);
  if (licensePlate != null) {
    closureAppointmentEntity.licensePlate = licensePlate;
  }
  final String? name = jsonConvert.convert<String>(json['name']);
  if (name != null) {
    closureAppointmentEntity.name = name;
  }
  final String? nameOfEscort = jsonConvert.convert<String>(json['nameOfEscort']);
  if (nameOfEscort != null) {
    closureAppointmentEntity.nameOfEscort = nameOfEscort;
  }
  final String? outGateNo = jsonConvert.convert<String>(json['outGateNo']);
  if (outGateNo != null) {
    closureAppointmentEntity.outGateNo = outGateNo;
  }
  final int? permissionType = jsonConvert.convert<int>(json['permissionType']);
  if (permissionType != null) {
    closureAppointmentEntity.permissionType = permissionType;
  }
  final String? personToPersonPhoneNumber = jsonConvert.convert<String>(json['personToPersonPhoneNumber']);
  if (personToPersonPhoneNumber != null) {
    closureAppointmentEntity.personToPersonPhoneNumber = personToPersonPhoneNumber;
  }
  final String? personType = jsonConvert.convert<String>(json['personType']);
  if (personType != null) {
    closureAppointmentEntity.personType = personType;
  }
  final String? personTypeValue = jsonConvert.convert<String>(json['personTypeValue']);
  if (personTypeValue != null) {
    closureAppointmentEntity.personTypeValue = personTypeValue;
  }
  final String? type = jsonConvert.convert<String>(json['type']);
  if (type != null) {
    closureAppointmentEntity.type = type;
  }
  final String? photoUrl = jsonConvert.convert<String>(json['photoUrl']);
  if (photoUrl != null) {
    closureAppointmentEntity.photoUrl = photoUrl;
  }
  final String? reasonForVisit = jsonConvert.convert<String>(json['reasonForVisit']);
  if (reasonForVisit != null) {
    closureAppointmentEntity.reasonForVisit = reasonForVisit;
  }
  final String? rejectInfo = jsonConvert.convert<String>(json['rejectInfo']);
  if (rejectInfo != null) {
    closureAppointmentEntity.rejectInfo = rejectInfo;
  }
  final int? reservationType = jsonConvert.convert<int>(json['reservationType']);
  if (reservationType != null) {
    closureAppointmentEntity.reservationType = reservationType;
  }
  final String? reviewedBy = jsonConvert.convert<String>(json['reviewedBy']);
  if (reviewedBy != null) {
    closureAppointmentEntity.reviewedBy = reviewedBy;
  }
  final String? reviewedDate = jsonConvert.convert<String>(json['reviewedDate']);
  if (reviewedDate != null) {
    closureAppointmentEntity.reviewedDate = reviewedDate;
  }
  final String? reviewedName = jsonConvert.convert<String>(json['reviewedName']);
  if (reviewedName != null) {
    closureAppointmentEntity.reviewedName = reviewedName;
  }
  final String? reviewedRemark = jsonConvert.convert<String>(json['reviewedRemark']);
  if (reviewedRemark != null) {
    closureAppointmentEntity.reviewedRemark = reviewedRemark;
  }
  final String? speciality = jsonConvert.convert<String>(json['speciality']);
  if (speciality != null) {
    closureAppointmentEntity.speciality = speciality;
  }
  final String? startDate = jsonConvert.convert<String>(json['startDate']);
  if (startDate != null) {
    closureAppointmentEntity.startDate = startDate;
  }
  final String? title = jsonConvert.convert<String>(json['title']);
  if (title != null) {
    closureAppointmentEntity.title = title;
  }
  final int? trafficStatus = jsonConvert.convert<int>(json['trafficStatus']);
  if (trafficStatus != null) {
    closureAppointmentEntity.trafficStatus = trafficStatus;
  }
  final String? transportMedium = jsonConvert.convert<String>(json['transportMedium']);
  if (transportMedium != null) {
    closureAppointmentEntity.transportMedium = transportMedium;
  }
  final String? updateBy = jsonConvert.convert<String>(json['updateBy']);
  if (updateBy != null) {
    closureAppointmentEntity.updateBy = updateBy;
  }
  final String? updateById = jsonConvert.convert<String>(json['updateById']);
  if (updateById != null) {
    closureAppointmentEntity.updateById = updateById;
  }
  final String? updateDate = jsonConvert.convert<String>(json['updateDate']);
  if (updateDate != null) {
    closureAppointmentEntity.updateDate = updateDate;
  }
  final String? visitorTelephone = jsonConvert.convert<String>(json['visitorTelephone']);
  if (visitorTelephone != null) {
    closureAppointmentEntity.visitorTelephone = visitorTelephone;
  }
  final int? waitingForInspectionStatus = jsonConvert.convert<int>(json['waitingForInspectionStatus']);
  if (waitingForInspectionStatus != null) {
    closureAppointmentEntity.waitingForInspectionStatus = waitingForInspectionStatus;
  }
  final int? sex = jsonConvert.convert<int>(json['sex']);
  if (sex != null) {
    closureAppointmentEntity.sex = sex;
  }
  final int? vehicleAppearanceStatus = jsonConvert.convert<int>(json['vehicleAppearanceStatus']);
  if (vehicleAppearanceStatus != null) {
    closureAppointmentEntity.vehicleAppearanceStatus = vehicleAppearanceStatus;
  }
  final List<String>? vehicleAppearance = (json['vehicleAppearance'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<String>(e) as String).toList();
  if (vehicleAppearance != null) {
    closureAppointmentEntity.vehicleAppearance = vehicleAppearance;
  }
  final int? driverLicenseStatus = jsonConvert.convert<int>(json['driverLicenseStatus']);
  if (driverLicenseStatus != null) {
    closureAppointmentEntity.driverLicenseStatus = driverLicenseStatus;
  }
  final List<String>? driverLicense = (json['driverLicense'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<String>(e) as String).toList();
  if (driverLicense != null) {
    closureAppointmentEntity.driverLicense = driverLicense;
  }
  final int? drivingLicenseStatus = jsonConvert.convert<int>(json['drivingLicenseStatus']);
  if (drivingLicenseStatus != null) {
    closureAppointmentEntity.drivingLicenseStatus = drivingLicenseStatus;
  }
  final List<String>? drivingLicense = (json['drivingLicense'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<String>(e) as String).toList();
  if (drivingLicense != null) {
    closureAppointmentEntity.drivingLicense = drivingLicense;
  }
  final int? goodsStatus = jsonConvert.convert<int>(json['goodsStatus']);
  if (goodsStatus != null) {
    closureAppointmentEntity.goodsStatus = goodsStatus;
  }
  final List<String>? goods = (json['goods'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<String>(e) as String).toList();
  if (goods != null) {
    closureAppointmentEntity.goods = goods;
  }
  final int? quantityOfGoods = jsonConvert.convert<int>(json['quantityOfGoods']);
  if (quantityOfGoods != null) {
    closureAppointmentEntity.quantityOfGoods = quantityOfGoods;
  }
  final String? waitingDescription = jsonConvert.convert<String>(json['waitingDescription']);
  if (waitingDescription != null) {
    closureAppointmentEntity.waitingDescription = waitingDescription;
  }
  final String? inspectedBy = jsonConvert.convert<String>(json['inspectedBy']);
  if (inspectedBy != null) {
    closureAppointmentEntity.inspectedBy = inspectedBy;
  }
  final String? inspectedById = jsonConvert.convert<String>(json['inspectedById']);
  if (inspectedById != null) {
    closureAppointmentEntity.inspectedById = inspectedById;
  }
  final String? inspectedTime = jsonConvert.convert<String>(json['inspectedTime']);
  if (inspectedTime != null) {
    closureAppointmentEntity.inspectedTime = inspectedTime;
  }
  return closureAppointmentEntity;
}

Map<String, dynamic> $ClosureAppointmentEntityToJson(ClosureAppointmentEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['affiliatedUnit'] = entity.affiliatedUnit;
  data['appointmentStatus'] = entity.appointmentStatus;
  data['carStatus'] = entity.carStatus;
  data['carType'] = entity.carType;
  data['carTypeValue'] = entity.carTypeValue;
  data['company'] = entity.company;
  data['companyCode'] = entity.companyCode;
  data['contactPerson'] = entity.contactPerson;
  data['contactPersonId'] = entity.contactPersonId;
  data['createBy'] = entity.createBy;
  data['createById'] = entity.createById;
  data['createDate'] = entity.createDate;
  data['deleted'] = entity.deleted;
  data['destination'] = entity.destination;
  data['empower'] = entity.empower;
  data['endDate'] = entity.endDate;
  data['expire'] = entity.expire;
  data['gateEquipmentList'] = entity.gateEquipmentList.map((v) => v.toJson()).toList();
  data['gateEquipmentNames'] = entity.gateEquipmentNames;
  data['id'] = entity.id;
  data['idCard'] = entity.idCard;
  data['idNo'] = entity.idNo;
  data['inGateNo'] = entity.inGateNo;
  data['licensePlate'] = entity.licensePlate;
  data['name'] = entity.name;
  data['nameOfEscort'] = entity.nameOfEscort;
  data['outGateNo'] = entity.outGateNo;
  data['permissionType'] = entity.permissionType;
  data['personToPersonPhoneNumber'] = entity.personToPersonPhoneNumber;
  data['personType'] = entity.personType;
  data['personTypeValue'] = entity.personTypeValue;
  data['type'] = entity.type;
  data['photoUrl'] = entity.photoUrl;
  data['reasonForVisit'] = entity.reasonForVisit;
  data['rejectInfo'] = entity.rejectInfo;
  data['reservationType'] = entity.reservationType;
  data['reviewedBy'] = entity.reviewedBy;
  data['reviewedDate'] = entity.reviewedDate;
  data['reviewedName'] = entity.reviewedName;
  data['reviewedRemark'] = entity.reviewedRemark;
  data['speciality'] = entity.speciality;
  data['startDate'] = entity.startDate;
  data['title'] = entity.title;
  data['trafficStatus'] = entity.trafficStatus;
  data['transportMedium'] = entity.transportMedium;
  data['updateBy'] = entity.updateBy;
  data['updateById'] = entity.updateById;
  data['updateDate'] = entity.updateDate;
  data['visitorTelephone'] = entity.visitorTelephone;
  data['waitingForInspectionStatus'] = entity.waitingForInspectionStatus;
  data['sex'] = entity.sex;
  data['vehicleAppearanceStatus'] = entity.vehicleAppearanceStatus;
  data['vehicleAppearance'] = entity.vehicleAppearance;
  data['driverLicenseStatus'] = entity.driverLicenseStatus;
  data['driverLicense'] = entity.driverLicense;
  data['drivingLicenseStatus'] = entity.drivingLicenseStatus;
  data['drivingLicense'] = entity.drivingLicense;
  data['goodsStatus'] = entity.goodsStatus;
  data['goods'] = entity.goods;
  data['quantityOfGoods'] = entity.quantityOfGoods;
  data['waitingDescription'] = entity.waitingDescription;
  data['inspectedBy'] = entity.inspectedBy;
  data['inspectedById'] = entity.inspectedById;
  data['inspectedTime'] = entity.inspectedTime;
  return data;
}

extension ClosureAppointmentEntityExtension on ClosureAppointmentEntity {
  ClosureAppointmentEntity copyWith({
    String? affiliatedUnit,
    int? appointmentStatus,
    String? carStatus,
    String? carType,
    String? carTypeValue,
    String? company,
    String? companyCode,
    String? contactPerson,
    String? contactPersonId,
    String? createBy,
    String? createById,
    String? createDate,
    String? deleted,
    String? destination,
    String? empower,
    String? endDate,
    int? expire,
    List<GateEquipmentEntity>? gateEquipmentList,
    String? gateEquipmentNames,
    String? id,
    String? idCard,
    String? idNo,
    String? inGateNo,
    String? licensePlate,
    String? name,
    String? nameOfEscort,
    String? outGateNo,
    int? permissionType,
    String? personToPersonPhoneNumber,
    String? personType,
    String? personTypeValue,
    String? type,
    String? photoUrl,
    String? reasonForVisit,
    String? rejectInfo,
    int? reservationType,
    String? reviewedBy,
    String? reviewedDate,
    String? reviewedName,
    String? reviewedRemark,
    String? speciality,
    String? startDate,
    String? title,
    int? trafficStatus,
    String? transportMedium,
    String? updateBy,
    String? updateById,
    String? updateDate,
    String? visitorTelephone,
    int? waitingForInspectionStatus,
    int? sex,
    int? vehicleAppearanceStatus,
    List<String>? vehicleAppearance,
    int? driverLicenseStatus,
    List<String>? driverLicense,
    int? drivingLicenseStatus,
    List<String>? drivingLicense,
    int? goodsStatus,
    List<String>? goods,
    int? quantityOfGoods,
    String? waitingDescription,
    String? inspectedBy,
    String? inspectedById,
    String? inspectedTime,
  }) {
    return ClosureAppointmentEntity()
      ..affiliatedUnit = affiliatedUnit ?? this.affiliatedUnit
      ..appointmentStatus = appointmentStatus ?? this.appointmentStatus
      ..carStatus = carStatus ?? this.carStatus
      ..carType = carType ?? this.carType
      ..carTypeValue = carTypeValue ?? this.carTypeValue
      ..company = company ?? this.company
      ..companyCode = companyCode ?? this.companyCode
      ..contactPerson = contactPerson ?? this.contactPerson
      ..contactPersonId = contactPersonId ?? this.contactPersonId
      ..createBy = createBy ?? this.createBy
      ..createById = createById ?? this.createById
      ..createDate = createDate ?? this.createDate
      ..deleted = deleted ?? this.deleted
      ..destination = destination ?? this.destination
      ..empower = empower ?? this.empower
      ..endDate = endDate ?? this.endDate
      ..expire = expire ?? this.expire
      ..gateEquipmentList = gateEquipmentList ?? this.gateEquipmentList
      ..gateEquipmentNames = gateEquipmentNames ?? this.gateEquipmentNames
      ..id = id ?? this.id
      ..idCard = idCard ?? this.idCard
      ..idNo = idNo ?? this.idNo
      ..inGateNo = inGateNo ?? this.inGateNo
      ..licensePlate = licensePlate ?? this.licensePlate
      ..name = name ?? this.name
      ..nameOfEscort = nameOfEscort ?? this.nameOfEscort
      ..outGateNo = outGateNo ?? this.outGateNo
      ..permissionType = permissionType ?? this.permissionType
      ..personToPersonPhoneNumber = personToPersonPhoneNumber ?? this.personToPersonPhoneNumber
      ..personType = personType ?? this.personType
      ..personTypeValue = personTypeValue ?? this.personTypeValue
      ..type = type ?? this.type
      ..photoUrl = photoUrl ?? this.photoUrl
      ..reasonForVisit = reasonForVisit ?? this.reasonForVisit
      ..rejectInfo = rejectInfo ?? this.rejectInfo
      ..reservationType = reservationType ?? this.reservationType
      ..reviewedBy = reviewedBy ?? this.reviewedBy
      ..reviewedDate = reviewedDate ?? this.reviewedDate
      ..reviewedName = reviewedName ?? this.reviewedName
      ..reviewedRemark = reviewedRemark ?? this.reviewedRemark
      ..speciality = speciality ?? this.speciality
      ..startDate = startDate ?? this.startDate
      ..title = title ?? this.title
      ..trafficStatus = trafficStatus ?? this.trafficStatus
      ..transportMedium = transportMedium ?? this.transportMedium
      ..updateBy = updateBy ?? this.updateBy
      ..updateById = updateById ?? this.updateById
      ..updateDate = updateDate ?? this.updateDate
      ..visitorTelephone = visitorTelephone ?? this.visitorTelephone
      ..waitingForInspectionStatus = waitingForInspectionStatus ?? this.waitingForInspectionStatus
      ..sex = sex ?? this.sex
      ..vehicleAppearanceStatus = vehicleAppearanceStatus ?? this.vehicleAppearanceStatus
      ..vehicleAppearance = vehicleAppearance ?? this.vehicleAppearance
      ..driverLicenseStatus = driverLicenseStatus ?? this.driverLicenseStatus
      ..driverLicense = driverLicense ?? this.driverLicense
      ..drivingLicenseStatus = drivingLicenseStatus ?? this.drivingLicenseStatus
      ..drivingLicense = drivingLicense ?? this.drivingLicense
      ..goodsStatus = goodsStatus ?? this.goodsStatus
      ..goods = goods ?? this.goods
      ..quantityOfGoods = quantityOfGoods ?? this.quantityOfGoods
      ..waitingDescription = waitingDescription ?? this.waitingDescription
      ..inspectedBy = inspectedBy ?? this.inspectedBy
      ..inspectedById = inspectedById ?? this.inspectedById
      ..inspectedTime = inspectedTime ?? this.inspectedTime;
  }
}
